// 注意C语言中的单引号和双引号的区别，单个字符需要单引号''
bool isLowAlpha(char x)
{
    if ((x >= 'a') && (x <= 'z'))
    {
        return true;
    }
    else
    {
        return false;
    }
}

bool detectCapitalUse(char *word)
{
    int len = strlen(word);
    int lowAlphaCnt = 0;
    int upAlphaCnt = 0;
    int idx;

    for (idx = 0; idx < len; idx++)
    {
        if (isLowAlpha(word[idx]) == true)
        {
            lowAlphaCnt++;
        }
        else
        {
            upAlphaCnt++;
        }
    }

    printf("lowAlphaCnt %d upAlphaCnt %d len %d\n", lowAlphaCnt, upAlphaCnt, len);
    //全是大写或者小写为正确
    if ((lowAlphaCnt == len) || (upAlphaCnt == len))
    {
        return true;
    }
    //仅首字母大写为正确
    if ((upAlphaCnt == 1) && (isLowAlpha(word[0]) == false))
    {
        return true;
    }
    return false;
}